﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>pageactions</title>

    <!-- WinJSContrib.Core references -->
    <script src="./scripts/jquery-2.1.1.js"></script>
    <script src="./scripts/winjscontrib/jquery.mcnext.WinJS.js"></script>
    <script src="./scripts/winjscontrib/mcnext.ui.utils.js"></script>
    <!-- WinJSContrib.Navigator references -->
    <script src="./scripts/winjscontrib/mcnext.ui.navigator.js"></script>

    <link href="pageactions.css" rel="stylesheet" />
    <script src="pageactions.js"></script>
</head>
<body>
    <div class="pageactions fragment">
        <header aria-label="Header content" role="banner">
            <button class="win-backbutton" aria-label="Back" disabled type="button"></button>
            <h1 class="titlearea win-type-ellipsis">
                <span class="pagetitle">page actions and page links</span>
            </h1>
            <div class="codelink" data-codepage="./pages/core/pageactions/pageactions"><span class="symbol">&#xE160;</span><span class="text">show me the code !</span></div>
        </header>
        <section class="desc-screen" aria-label="Main content" role="main">
            <div class="bloc-description">
                <p>Page actions and page links are shortcuts to help you bind some user interactions directly into your markup by adding some attributes.</p>
                <p>
                    When you are using our custom navigator, those attributes are resolved during page construction, but you can trigger them using MCNEXT.Utils.bindActions.
                </p>
            </div>
            <div></div>
            <div class="bloc-content">
                <p>The following button is bound to the "alertMe" function on the page. You could optionnaly add arguments to the action using strict JSON.</p>
                <button data-page-action="alertMe" data-page-action-args='{"title": "WinJS Contrib rocks"}'>click me</button>

                <p>If you need to provide argument to a page action, you could also use a function.</p>
                <button data-page-action="alertMe" data-page-action-args='page:pageActionArgCallback'>click me</button>

                <p>The button bellow will navigate to another page. You could optionnaly add arguments to the navigation using strict JSON, or with a function, just like page actions.</p>
                <button data-page-link="./pages/core/eventtracker/eventtracker.html" data-page-action-args='{"customArg": "optional argument"}'>click me</button>
            </div>
        </section>
    </div>
</body>
</html>
